<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\widgets\ActiveForm;
use kartik\date\DatePicker;
/* $this yii\web\View; */
/* $model backend\modules\admin\models\Role */
?>

<div class="row">

    <div class="col-xs-12">
        
        <div class="card">

            <div class="header">
                <h4 class="title">
                    <?= $this->title ?>更改党支部
                </h4>
                <br>
                <a href="<?=Url::toRoute(['index']); ?>" ><i class="icon-home home-icon"> 返回列表页</i></a>
            </div>
            <div class="content">

                <!-- PAGE CONTENT BEGINS -->
                <?php
                $label_class=['class'=>'col-sm-3 control-label no-padding-right'];
                $model->certify_time = date('Y-m-d');
                $form = ActiveForm::begin(
                    [
                        'fieldConfig'=>[
                            'options' => ['enctype' => 'multipart/form-data', 'class' => 'form-horizontal'],
                            'template'=> "<div class=\"form-group\">{label}\n<div class=\"col-sm-5\">{input}</div><div class=\"col-sm-3\">{error}</div></div>",
                            'labelOptions' =>['class' => $label_class],
                        ],
                        'enableClientValidation' => false,
                        'method' => 'post',
                    ]
                );
                ?>
                <?= $form->field($model, 'realname')->textInput(['maxlength' =>20,'readonly'=>'true', 'class'=>'form-control border-input'])?>

                <?= $form->field($model, 'branch_id')
                    ->dropDownList(ArrayHelper::map($branches, 'id', 'name'), ['prompt' => '请选择党支部'])
                    ->label('所属党支部', ['class' => 'col-sm-3 control-label no-padding-right']) ?>


                <?= $form->field($model, 'certify_time')->label('迁移时间')->widget(DatePicker::classname(), [
                    'options' => ['placeholder' => '','class'=>'form-control border-input'],
                    'pluginOptions' => [
                        'autoclose' => true,
                        'todayHighlight' => true,
                        'format' => 'yyyy-mm-dd',
                    ]
                ]); ?>
                <div class="form-horizontal field-user-branch_id">
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right"  for="user-note">备注信息</label>
                        <div class="col-sm-5">
                            <input type="text" id="user-note" class="form-control border-input"
                                                     name="User[note]" value="" placeholder="备注信息" maxlength="200"></div>
                        <div class="col-sm-3">
                            <div class="help-block"></div>
                        </div>
                    </div>
                </div>
                <div class="clearfix">
                    <div class="col-md-offset-3 col-md-9">
                        <?= Html::submitButton('提交', ['class'=>'btn btn-info','name' =>'submit-button']) ?>
                        <?= Html::resetButton('重置', ['class'=>'btn btn-primary','name' =>'reset-button']) ?>
                    </div>
                </div>
                <?php ActiveForm::end(); ?>
                <div class="space-4"></div>

                <!-- PAGE CONTENT ENDS -->


            </div><!-- /.content -->
            
        </div><!-- /.card -->
    </div><!-- /.col -->

</div><!-- /.row -->

